package com.example.tablefield.entites;

import lombok.Data;

import java.util.List;

/**
 * @version 1.0
 * @author:yuansen
 * @create:2025/8/19 17:36
 * @description:
 * @ClassName: CronTriggerConfig
 * @company TRS
 */
@Data
//@EqualsAndHashCode
//@ToString
//@JsonTypeName("CRON")
public class CronTriggerConfig implements TriggerConfig {

    public enum IntervalUnit {
        day, week, month
    }

    /**
     * 每条规则的唯一id，用于区分不同规则
     */
    private Long id;
    private IntervalUnit intervalUnit;
    private Integer every;
    private List<Integer> selectedDays;
    private String executeTime;
    private String timezone = "Asia/Shanghai";

    /**
     * 关联的执行任务ID（如 XXL-JOB）
     * 仅 Cron 触发器需要
     */
    private Integer jobId;

    /**
     * Cron 表达式
     * 仅 Cron 触发器需要
     */
    private String cronExpression;

    /**
     * 配置来源类型
     */
    private String sourceType = "wizard";
}
